package org.codeart.api_driver.remote;

import org.codeart.common.dto.Car;
import org.codeart.common.dto.DriverCarBindingRelationship;
import org.codeart.common.dto.DriverUser;
import org.codeart.common.dto.DriverUserWorkStatus;
import org.codeart.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(name = "service-driver-user")
public interface ServiceDriverUserClient {

    @PutMapping("/user")
    R<Void> updateUser(@RequestBody DriverUser driverUser);

    @GetMapping("/check-driver/{driverPhone}")
    R<Map<Object, Object>> getUser(@PathVariable("driverPhone") String driverPhone);

    @GetMapping("/car")
    R<Car> getCarById(@RequestParam("carId") Long carId);

    @PutMapping("/driver-user-work-status")
    R<Void> changeWorkStatus(@RequestBody DriverUserWorkStatus driverUserWorkStatus);

    @GetMapping("/driver-car-binding-relationship/{driverPhone}")
    R<DriverCarBindingRelationship> getDriverCarRelationShip(@PathVariable("driverPhone") String driverPhone);

    @GetMapping("/work-status")
    R<DriverUserWorkStatus> getWorkStatus(@RequestParam("driverId") Long driverId);

}
